import Cookies from 'js-cookie'
const layout = {
  state: {
    layoutType: !+Cookies.get('sidebarStatus')
  },

  mutations: {
    LAYOUTTYPE: state => {
      if (state.layoutType) {
        Cookies.set('sidebarStatus', 1)
      } else {
        Cookies.set('sidebarStatus', 0)
      }
      state.layoutType = !state.layoutType
    }
  },
  actions: {
    ToggleSideBar ({ commit }) {
      commit('LAYOUTTYPE')
    }
  }
}
export default layout
